<template>
  <div class="child">
    <h1>子组件{{ num }}</h1>
  </div>
</template>
<script>
export default {
  props: {
    num: {
      type: Number,
    },
  },
  beforeCreate() {
    console.log("child:" + "beforeCreate");
  },
  created() {
    console.log("child:" + "created");
  },
  beforeMount() {
    console.log("child:" + "beforeMount");
  },
  mounted() {
    console.log("child:" + "mounted");
  },
  beforeUnmount() {
    console.log("child:销毁之前");
  },
  unmounted() {
    console.log("child:销毁");
  },
  beforeUpdate() {
    /* data数据更新了,数据还没有渲染到DOM上 */
    console.log("child:组件更新之前");
  },
  updated() {
    console.log("child:组件更新之后");
  },
  beforeUnmount() {
    console.log("child:销毁之前");
  },
  unmounted() {
    console.log("child:销毁");
  },
};
</script>
<style></style>
